import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 部门列表
export const ucDeptListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucDeptList',
      data: data
    }
  })
}

// 部门修改
export const ucDeptEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucDeptEdit',
      data: data
    }
  })
}

// 部门新增
export const ucDeptAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucDeptAdd',
      data: data
    }
  })
}

// 部门删除
export const ucDeptDelApi = (data: { dept_id?: number | string }) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucDeptDel',
      data: data
    }
  })
}
